#define _CRT_SECURE_NO_WARNINGS 
#include <stdio.h>
int main() {
	int money = 0;
	scanf("%d", &money);
	int total;
	int exmpty;
	if (money == 0)
		total = 0;
	else
		total = 2 * money - 1;
	//total = money;
	//exmpty = money;
	//while (exmpty >= 2) {
	//	total += exmpty / 2;
	//	exmpty = exmpty / 2 + exmpty % 2;
	//}
	printf("%d", total);
	return 0;
}